package com.hxn.wxshake.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @ClassName WXSendUserInfo
 * @Description 微信获取用户信息
 * @Author hxn
 * @Date 2019/8/6 13:46
 * @Version 1.0
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class WXSendUserInfo {

    private final static String OAUTH2 = "https://open.weixin.qq.com/connect/oauth2/authorize";

    private String appid;
    private String redirectUri;
    private String responseType;
    private String scope;
    private String state;
    private String connectRedirect;

    public String getSendUserInfoUrl() {
        StringBuilder sendUserInfoUrlSB = new StringBuilder();
        sendUserInfoUrlSB.append(OAUTH2)
                .append("?")
                .append("appid=").append(appid).append("&")
                .append("redirect_uri=").append(redirectUri).append("&")
                .append("response_type=").append(responseType).append("&")
                .append("scope=").append(scope).append("&")
                .append("state=").append(state).append("&")
                .append("connect_redirect=").append(connectRedirect).append("#wechat_redirect");

        return sendUserInfoUrlSB.toString();
    }
}
